﻿using System.Collections.Generic;
using BCCommon.Enums;
using BCCommon.PaymentEnums;
using BCService.Common.Payment.Payment.WeixinPay;

namespace BCService.Common.Payment.Payment
{
    /// <summary>
    /// 微信支付
    /// </summary>
    public interface IWeixinPayHelper
    {
        /// <summary>
        /// 获取微信支付组件
        /// </summary>
        /// <returns></returns>
        IWeiXinPayPlug GetWeiXinPayPlug();
        /// <summary>
        /// 调起支付
        /// </summary>
        /// <param name="appType">应用类型</param>
        /// <param name="osType">系统类型</param>
        /// <param name="payChannelType">支付渠道</param>
        /// <param name="userId">用户Id</param>
        /// <param name="paymentRecordId">支付记录Id</param>
        /// <param name="subject">交易订单标题</param>
        /// <param name="newAmount">金额</param>
        /// <param name="orderType">订单类型</param>
        /// <param name="referenceNumber">相关业务编号</param>
        /// <param name="tradeType">交易类型</param>
        /// <param name="createIP">来源Ip</param>
        /// <returns></returns>
        SortedDictionary<string, object> CreateTryPay(SourceAppType appType, SourceOSType osType, PaymentChannelType payChannelType, long userId, long paymentRecordId,string subject, decimal newAmount, FlowType orderType, string referenceNumber, string tradeType, string createIP);
        /// <summary>
        /// 获取支付二维码
        /// </summary>
        /// <param name="appType">APP类型</param>
        /// <param name="osType">环境操作系统</param>
        /// <param name="payChannelType">支付渠道类型</param>
        /// <param name="userId">用户Id</param>
        /// <param name="paymentRecordId">支付记录Id</param>
        /// <param name="subject">交易订单标题</param>
        /// <param name="newAmount">金额</param>
        /// <param name="orderType">支付业务类型</param>
        /// <param name="referenceNumber">订单号</param>
        /// <param name="tradeType">交易方式</param>
        /// <param name="createIP">请求Ip</param>
        /// <returns></returns>
        SortedDictionary<string, object> CreatQRCode(SourceAppType appType, SourceOSType osType, PaymentChannelType payChannelType, long userId, long paymentRecordId,string subject, decimal newAmount, FlowType orderType, string referenceNumber, string tradeType, string createIP);


        /// <summary>
        /// 获取授权信息
        /// </summary>
        /// <param name="appType">App类型</param>
        /// <param name="code">code码</param>
        /// <returns></returns>
        string GetAuthInfo(SourceAppType appType, string code);
        /// <summary>
        /// 订单查询
        /// </summary>
        /// <param name="appType">APP类型</param>
        /// <param name="out_trade_no">商户系统内部的订单号</param>
        /// <returns></returns>
        SortedDictionary<string, object> OrderQuery(SourceAppType appType, long out_trade_no);
        /// <summary>
        /// 退款
        /// </summary>
        /// <param name="payChannelType">支付渠道类型</param>
        /// <param name="userId">用户Id</param>
        /// <param name="appType">APP类型</param>
        /// <param name="osType">环境操作系统</param>
        /// <param name="trade_no">订单号</param>
        /// <param name="outTradeNo">退款订单号</param>
        /// <param name="refundAmount">退款金额</param>
        /// <param name="amount">总订单金额</param>
        /// <returns></returns>
        SortedDictionary<string, object> Refund(PaymentChannelType payChannelType, long userId, SourceAppType appType, SourceOSType osType, long trade_no, string outTradeNo, decimal refundAmount, decimal amount);
        /// <summary>
        /// 企业付款（提现）
        /// </summary>
        /// <param name="appType">系统类型</param>
        /// <param name="trade_no">订单编号</param>
        /// <param name="openId">开放Id</param>
        /// <param name="amount">金额</param>
        /// <param name="createIP">访问IP</param>
        /// <returns></returns>
        SortedDictionary<string, object> Transfers(SourceAppType appType, long trade_no, string openId, decimal amount, string createIP);
    }
}